perm filename ROMANU.TMP[CM,DEK] blob sn#788858 filedate 1985-04-02 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00028 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00003 00002	% Computer Modern Roman upper case:
C00004 00003	cmchar "The letter A"
C00008 00004	cmchar "The letter B"
C00011 00005	cmchar "The letter C"
C00014 00006	cmchar "The letter D"
C00016 00007	cmchar "The letter E"
C00019 00008	cmchar "The letter F"
C00021 00009	cmchar "The letter G"
C00025 00010	cmchar "The letter H"
C00027 00011	cmchar "The letter I"
C00028 00012	cmchar "The letter J"
C00030 00013	cmchar "The letter K"
C00037 00014	cmchar "The letter L"
C00039 00015	cmchar "The letter M"
C00043 00016	cmchar "The letter N"
C00046 00017	cmchar "The letter O"
C00048 00018	cmchar "The letter P"
C00050 00019	cmchar "The letter Q"
C00052 00020	cmchar "The letter R"
C00055 00021	cmchar "The letter S"
C00058 00022	cmchar "The letter T"
C00060 00023	cmchar "The letter U"
C00062 00024	cmchar "The letter V"
C00065 00025	cmchar "The letter W"
C00069 00026	cmchar "The letter X"
C00072 00027	cmchar "The letter Y"
C00075 00028	cmchar "The letter Z"
C00077 ENDMK
C⊗;
% Computer Modern Roman upper case:
% These letters were originally coded by D. E. Knuth in November, 1979,
% inspired by the Monotype alphabets used in {\sl The Art of Computer Programming}.
% Sans serif designs by Richard Southall were added in April, 1982.
% The programs were revised for the new \MF\ conventions in 1985.

% Character codes \0101 through \0132 are generated.

% Note: I should change "round" to "vround" in lotsa places, also in other files!
cmchar "The letter A";
beginchar("A",13u#,cap_height#,0);
adjust_fit(cap_serif_fit#,cap_serif_fit#);
numeric left_stem,outer_jut,notch_height,alpha;
left_stem=cap_hair if notched: -3stem_corr fi;
outer_jut=.8cap_jut; x1l=w-x4r=l+letter_fit+outer_jut+.5u; y1=y4=0;
x2-x1=x4-x3; x3r=x2r+apex_corr; y2=y3=h+apex_o;
alpha=diag_ratio(2,left_stem,y2-y1,x4r-x1l-apex_corr);
penpos1(alpha*left_stem,0); penpos2(alpha*left_stem,0);
penpos3(alpha*cap_stem,0); penpos4(alpha*cap_stem,0);
z0=whatever[z1r,z2r]=whatever[z3l,z4l]; notch_height=h-cap_hair;
if notched and (y0<notch_height): y0:=notch_height;
  fill z0+.5right{down}...{z4-z3}diag_end(3l,4l,4r,3r)
    --diag_end(4r,3r,2l,1l)--diag_end(2l,1l,1r,2r){z2-z1}
    ...{up}z0+.5left--cycle; % left and right diagonals
else: fill z0--diag_end(0,4l,4r,3r)--diag_end(4r,3r,2l,1l)
    --diag_end(2l,1l,1r,0)--cycle; fi % left and right diagonals
penpos5(whatever,angle(z2-z1)); z5=whatever[z1,z2];
penpos6(whatever,angle(z3-z4)); z6=whatever[z3,z4]; y6=y5;
if notched: y5r else: y5 fi =bar_height;
y5r-y5l=y6r-y6l=cap_bar; penstroke z5e--z6e; % bar line
if serifs: numeric inner_jut; pickup tiny_pen;
 diag_inside(1,2); diag_inside(4,3);
 if rt x1'r+cap_jut+1.5u+2≤lft x4'l-cap_jut: inner_jut=cap_jut;
 else: rt x1'r+inner_jut+1.5u+2=lft x4'l-inner_jut; fi
 cup_serif(1',2,a,b,1/2,outer_jut,.6,inner_jut)(dark);	% left serif
 cup_serif(4',3,c,d,1/2,inner_jut,1/3,outer_jut); fi	% right serif
penlabels(0,1,2,3,4,5,6); endchar;
cmchar "The letter B";
beginchar("B",12.5u#,cap_height#,0);
italcorr .75cap_height#*slant-.5u#;
adjust_fit(cap_serif_fit#,0);
numeric left_stem,right_curve,middle_weight;
left_stem=cap_stem-round 2stem_corr; middle_weight=.6vair+.5;
penpos1(left_stem-tiny,0); penpos2(left_stem-tiny,0);
pickup tiny_pen; top y1=h; bot y2=0;
lft x1l=lft x2l=round max(2u,3u-.5left_stem);
filldraw stroke z1e--z2e; % stem
penpos3(cap_band,90); penpos4(cap_band,90);
penpos6(middle_weight,-90); penpos7(middle_weight,-90);
penpos8(middle_weight,90); penpos9(middle_weight,90);
penpos5(right_curve-stem_corr,0); penpos10(right_curve,0);
penpos11(cap_band,-90); penpos12(cap_band,-90);
z3r=top z1; y4=y3; y5=.5[y4,y6]; y6=y7; y7l-y8l=vair;
z12r=bot z2; y11=y12; y10=.5[y11,y9]; y8=y9; y8l=.5h;
x4=x6; x9=x11=x4+.5u; x7=x8=x1; x9l:=x4+.25u;
x5r=round(w-1.5u); x10r=round(w-u);
if serifs: right_curve=cap_curve-stem_corr; x4=.5[x1,w-1.5u];
else: right_curve=cap_curve-3stem_corr; x4=.5[x1,w-2.5u];
 x4l:=x4l-.5u; x6l:=x6l-.5u; x9l:=x9l-.5u; x11l:=x11l-.5u; fi
fill stroke z3e..super_arc.e(4,5) & super_arc.e(5,6)..z7e;	% upper lobe
fill stroke z8e..super_arc.e(9,10) & super_arc.e(10,11)..z12e;	% lower lobe
if serifs: cup_serif(1,2,a,b,1/3,cap_jut,1/3,.5cap_jut);	% upper serif
 cup_serif(2,1,c,d,1/3,cap_jut,1/3,.5cap_jut); fi	% lower serif
math_fit(0,.5ic#); penlabels(1,2,3,4,5,6,7,8,9,10,11,12); endchar;
cmchar "The letter C";
if serifs: beginchar("C",13u#,cap_height#,0);
 italcorr cap_height#*slant-.5u#;
 adjust_fit(0,0);
 pickup teeny_pen; penpos1(cap_hair-teeny,0); penpos2(vair+hair_corr-teeny,90);
 penpos3(cap_curve-teeny,180); penpos4(vair+hair_corr-teeny,270);
 penpos5(hair-teeny,360);
 rt x1r=rt x5r=round(w-u); lft x3r=round u; x2=x4=.55[x3,x1];
 top y2r=h+o; bot y4r=-o; y3=.5[y2,y4];
 bot y1=round max(.6h,x_height-.5teeny); y5=good.y .95(h-y1);
 (x2l,y2l')=whatever[z2r,z1l]; y2l:=y2l';
 (x4l,y4l')=whatever[z4r,z5l]; y4l:=y4l';
 filldraw stroke z1e{curl .5}
  ..z2e{left}&pulled_super_arc.e(2,3,superpull)
  & pulled_super_arc.e(3,4,superpull)&z4e{right}..z5e; % arc
 x6=x1r; top y6=h; x1r-x1'=cap_curve-teeny; y1'=y1;
 path upper_arc; upper_arc=z1{curl .5}..z2{left};
 numeric t; t=xpart(upper_arc intersectiontimes (z6..z1'));
 filldraw z1r--z6--subpath(t,0) of upper_arc--cycle; % barb
else: beginchar("C",11.5u#,cap_height#,0);
 italcorr cap_height#*slant-.5u#;
 adjust_fit(0,0);
 pickup teeny_pen; penpos1(1.1flare-teeny,90); penpos2(slab-teeny,90);
 penpos3(cap_curve-teeny,180); penpos4(slab-teeny,270);
 penpos5(flare-teeny,270);
 rt x1r=round(w-1.25u); x2=x4=.5w+1.25u;
 lft x3r=round max(u,2u-.5cap_curve); rt x5l=round(w-u);
 top y1r=round .95h+o; top y2r=h+o; y3=.5h; bot y4r=-o; bot y5r=round .07h-o;
 (x5r',y5r)=whatever[z5l,(w,h)]; x5r:=good.x x5r';
 filldraw stroke z1e..tension.9..z2e{left}&super_arc.e(2,3)
  & super_arc.e(3,4) & z4e{right}..z5e; fi % arc and terminals
math_fit(-.3cap_height#*slant-.5u#,.5ic#); penlabels(1,1',2,3,4,5,6); endchar;
cmchar "The letter D";
beginchar("D",13.5u#,cap_height#,0);
italcorr .7cap_height#*slant-.5u#;
adjust_fit(cap_serif_fit#,0);
penpos1(cap_stem'-tiny,0); penpos2(cap_stem'-tiny,0);
pickup tiny_pen; top y1=h; bot y2=0;
lft x1l=lft x2l=round max(2u,3u-.5cap_stem');
filldraw stroke z1e--z2e; % stem
penpos3(cap_band,90); penpos4(cap_band,90);
penpos5(cap_curve-stem_corr,0);
penpos6(cap_band,-90); penpos7(cap_band,-90);
z3r=top z1; y4=y3; y5=.51[y4,y6]; y6=y7;
z7r=bot z2; x4=x6=.5w+.25u; x5r=round(w-u);
x4l:=x6l:=x4-.25cap_curve;
fill stroke z3e..pulled_super_arc.e(4,5,superpull)
  & pulled_super_arc.e(5,6,superpull)..z7e;	% lobe
if serifs: cup_serif(1,2,a,b,1/3,cap_jut,1/3,.5cap_jut);	% upper serif
 cup_serif(2,1,c,d,1/3,cap_jut,1/3,.5cap_jut); fi	% lower serif
math_fit(0,ic#-.5u#); penlabels(1,2,3,4,5,6,7); endchar;
cmchar "The letter E";
beginchar("E",12u#-width_adj#,cap_height#,0);
italcorr cap_height#*slant-beak_jut#-.5u#;
adjust_fit(cap_serif_fit#,0);
h:=round(h-stem_corr);
penpos1(cap_stem-tiny,0); penpos2(cap_stem-tiny,0);
pickup tiny_pen; top y1=h; bot y2=0;
lft x1l=lft x2l=round max(2u,3u-.5cap_stem);
filldraw stroke z1e--z2e; % stem
pickup crisp_pen; penpos3(slab-crisp,90); penpos4(hair-crisp,0);
top y3r=h; x3=x1; rt x4r=round(w-u); y4=good.y(y3l-beak);
arm.e(3,4,beak_darkness,beak_jut);	% upper arm and beak
penpos5(cap_bar-crisp,-90); penpos6(hair-crisp,0);
top y5l=round(.52[y2,y1]+.5cap_bar); x5=x1;
penpos0(cap_bar-crisp,90); penpos7(hair-crisp,0);
z0=z5; x6=x7; y6-y5l=y0l-y7;
if serifs: rt x6r=round(w-4.75u+.5hair); y6=good.y(y5l+.7beak);
 rt x9r=round(w-.5u);
else: rt x6r=round(w-1.5u); y6=y5l; rt x9r=round(w-.75u); fi
arm.f(5,6,beak_darkness,0); arm.g(0,7,beak_darkness,0);	% middle arm and serif
penpos8(slab if not serifs:+2stem_corr fi-crisp,-90); penpos9(hair-crisp,0);
bot y8r=0; x8=x2; y9=y8l+7/6beak;
arm.h(8,9,beak_darkness,1.5beak_jut);	% lower arm and beak
if serifs: cup_serif(1,2,a,b,1/3,cap_jut,1/3,.5cap_jut);	% upper serif
 cup_serif(2,1,c,d,1/3,cap_jut,1/3,.5cap_jut); fi	% lower serif
math_fit(0,.5ic#); penlabels(0,1,2,3,4,5,6,7,8,9); endchar;
cmchar "The letter F";
beginchar("F",11.5u#-width_adj#,cap_height#,0);
italcorr cap_height#*slant-beak_jut#-.5u#;
adjust_fit(cap_serif_fit#,0);
h:=round(h-stem_corr);
penpos1(cap_stem-tiny,0); penpos2(cap_stem-tiny,0);
pickup tiny_pen; top y1=h; bot y2=0;
lft x1l=lft x2l=round max(2u,3u-.5cap_stem);
filldraw stroke z1e--z2e; % stem
pickup crisp_pen; penpos3(slab-crisp,90); penpos4(hair-crisp,0);
top y3r=h; x3=x1; rt x4r=round(w-u); y4=good.y(y3l-beak);
arm.e(3,4,beak_darkness,beak_jut);	% upper arm and beak
penpos5(cap_bar-crisp,-90); penpos6(hair-crisp,0);
top y5l=round(.5[y2,y1]+.5cap_bar); x5=x1;
penpos0(cap_bar-crisp,90); penpos7(hair-crisp,0);
z0=z5; x6=x7; y6-y5l=y0l-y7;
if serifs: rt x6r=round(w-4.5u+.5hair); y6=good.y(y5l+.7beak);
 rt x9r=round(w-.5u);
else: rt x6r=round(w-1.5u); y6=y5l; rt x9r=round(w-.75u); fi
arm.f(5,6,beak_darkness,0); arm.g(0,7,beak_darkness,0);	% middle arm and serif
if serifs: cup_serif(1,2,a,b,1/3,cap_jut,1/3,.5cap_jut);	% upper serif
 cup_serif(2,1,c,d,1/3,cap_jut,1/3,1.25cap_jut); fi	% lower serif
math_fit(0,ic#-2.5u#); penlabels(0,1,2,3,4,5,6,7,8,9); endchar;
cmchar "The letter G";
if serifs: beginchar("G",14u#,cap_height#,0);
 italcorr cap_height#*slant-1.5u#-.5cap_serif_fit#;
 adjust_fit(0,.5cap_serif_fit#);
 pickup tiny_pen; penpos0(cap_stem-tiny,0); penpos7(cap_stem-tiny,0);
 rt x0r=round(w-2u); y0=good.y(.1[bar_height,x_height]); x7=x0;
 pickup teeny_pen;
 if notched: bot y7=0; penpos5(cap_stem-teeny,0);
  x5=x0; top y5=y0+pen_top_[tiny_pen];
 else: penpos5(cap_hair-teeny,0); penpos8(cap_stem-teeny,0);
  y7=.5bar_height; z5l=z8l; z8=z7; x9=x8r; bot y9=0;
  filldraw z8l{down}..{curl 0}z9--z8r--cycle; fi % spur
 penpos1(cap_hair-teeny,0); penpos2(vair+hair_corr-teeny,90);
 penpos3(cap_curve-teeny,180); penpos4(vair+hair_corr-teeny,270);
 rt x1r=round(w-2u); lft x3r=round u; x2=x4=.55[x3,x1];
 top y2r=h+o; bot y4r=-o; y3=.5[y2,y4];
 bot y1=round max(.6h,x_height-.5teeny);
 (x2l,y2l')=whatever[z2r,z1l]; y2l:=y2l';
 (x4l,y4l')=whatever[z4r,z0l]; y4l:=y4l';
 filldraw stroke z1e{curl .5}
  ..z2e{left}&pulled_super_arc.e(2,3,superpull)
  & pulled_super_arc.e(3,4,superpull)&z4e{right}...z5e{up}; % arc
 x6=x1r; top y6=h; x1r-x1'=cap_curve-teeny; y1'=y1;
 path upper_arc; upper_arc=z1{curl .5}..z2{left};
 numeric t; t=xpart(upper_arc intersectiontimes (z6..z1'));
 filldraw subpath(0,t) of upper_arc--z6--z1r--z1--cycle; % barb
 pickup tiny_pen; filldraw stroke z0e--z7e;	% stem
 cup_serif(0,7,a,b,1/3,max(cap_jut,2.25u),1/3,1.25u);	% serif
 math_fit(-.3cap_height#*slant-.5u#,ic#);
else: beginchar("G",12u#,cap_height#,0);
 italcorr cap_height#*slant-.5u#;
 adjust_fit(0,0);
 pickup teeny_pen; penpos1(1.2flare-teeny,90); penpos2(slab-teeny,90);
 penpos3(cap_curve-teeny,180); penpos4(slab-teeny,270);
 penpos5(flare-teeny,270);
 rt x1r=round(w-1.5u); x2=x4=.5w+u;
 lft x3r=round max(u,2u-.5cap_curve); rt x5l=round(w-1.2u);
 top y1r=round .93h+o; top y2r=h+o; y3=.5h; bot y4r=-o; bot y5r=round .07h-o;
 filldraw stroke z1e..tension.9..z2e{left}&super_arc.e(2,3)
  & super_arc.e(3,4) & z4e{right}..z5e; % arc and terminals
 penpos0(stem-teeny,0); penpos7(stem-teeny,0);
 z7r=z5r; x0=x7; top y0=round(.35[bar_height,x_height]);
 filldraw stroke z0e--z7e;	% stem
 penpos8(cap_bar-teeny,90); penpos9(cap_bar-teeny,90);
 z0r=z9r; y8=y9; lft x8=round x4;
 filldraw stroke z8e--z9e;	% bar
 math_fit(-.3cap_height#*slant-.5u#,.5ic#); fi
penlabels(0,1,1',2,3,4,5,6,7,8,9); endchar;
cmchar "The letter H";
beginchar("H",13u#+width_adj#,cap_height#,0);
italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
adjust_fit(cap_serif_fit#,cap_serif_fit#);
penpos1(cap_stem-tiny,0); penpos2(cap_stem-tiny,0);
penpos3(cap_stem-tiny,0); penpos4(cap_stem-tiny,0);
pickup tiny_pen; top y1=top y3=h; bot y2=bot y4=0;
lft x1l=lft x2l=round max(2u,3u-.5cap_stem); x3=x4=w-x1;
filldraw stroke z1e--z2e; % left stem
filldraw stroke z3e--z4e; % right stem
penpos5(cap_bar,90); penpos6(cap_bar,90);
x5=x1; x6=x3; y5=y6=.52h;
fill stroke z5e--z6e;	% bar
if serifs: numeric inner_jut;
 if rt x1r+cap_jut+1.5u+2≤lft x3l-cap_jut: inner_jut=cap_jut;
 else: rt x1r+inner_jut+1.5u+2=lft x3l-inner_jut; fi
 cup_serif(1,2,a,b,1/3,cap_jut,1/3,inner_jut);	% upper left serif
 cup_serif(2,1,c,d,1/3,cap_jut,1/3,inner_jut); % lower left serif
 cup_serif(3,4,e,f,1/3,inner_jut,1/3,cap_jut);	% upper left serif
 cup_serif(4,3,g,h,1/3,inner_jut,1/3,cap_jut); fi	% lower left serif
math_fit(0,.5ic#); penlabels(1,2,3,4,5,6); endchar;
cmchar "The letter I";
beginchar("I",max(6u#,4u#+cap_stem#),cap_height#,0);
italcorr cap_height#*slant-.25u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
penpos1(cap_stem-tiny,0); penpos2(cap_stem-tiny,0);
pickup tiny_pen; top y1=h; bot y2=0; x1=x2=good.x .5w;
filldraw stroke z1e--z2e; % stem
if serifs: 
 cup_serif(1,2,a,b,1/3,1.05cap_jut,1/3,1.05cap_jut);	% upper serif
 cup_serif(2,1,c,d,1/3,1.05cap_jut,1/3,1.05cap_jut);	fi % lower serif
math_fit(0,.5ic#); penlabels(1,2); endchar;
cmchar "The letter J";
beginchar("J",9u#,cap_height#,0);
italcorr cap_height#*slant-cap_serif_fit#+.75cap_jut#-2.5u#+min(.5cap_stem#,u#);
adjust_fit(0,cap_serif_fit#);
pickup tiny_pen; penpos1(cap_stem'-tiny,0); penpos2(cap_stem'-tiny,0);
top y1=h; rt x1r=round(w-2u); x2=x1; y2=.21h;
if serifs: penpos3(vair-tiny,-90); penpos4(cap_hair-tiny,-180);
 penpos5(flare+(cap_stem-stem)-tiny,-180);
 bot y3r=-o; x3=.5[x4,x2]; y5=1/6h; rt x5l=round 2.75u;
 filldraw stroke z1e--z2e&super_arc.e(2,3);	% stem and arc
 cup_serif(1,2,a,b,1/3,1.25cap_jut,1/3,.75cap_jut);	% serif
 bulb(3,4,5);	% bulb
else: filldraw stroke z1e--z2e;	% stem
 pickup teeny_pen; penpos3(cap_stem'-teeny,0); z3=z2;
 penpos4(flare-teeny,angle(6.5u,-h)); penpos5(1.1flare-teeny,-90);
 bot y4r=-o; x4r=.5[x5r,x3r]; lft x5=round.75u; bot y5r=round.06h-o;
 filldraw stroke z3e{down}
  ..tension atleast.9..z4e{left}..z5e; fi % arc and terminal
math_fit(0,.5ic#-.5u#); penlabels(1,2,3,4,5); endchar;
cmchar "The letter K";
beginchar("K",13.5u#,cap_height#,0);
italcorr cap_height#*slant-.5u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
numeric right_jut,alpha[];
if serifs: right_jut=.8cap_jut;
else: right_jut=.4tiny; fi
penpos1(fudged.cap_stem-tiny,0); penpos2(fudged.cap_stem-tiny,0);
pickup tiny_pen; top y1=h; bot y2=0;
lft x1l=lft x2l=round max(2u,3u-.5fudged.cap_stem);
filldraw stroke z1e--z2e; % stem
top y3=h; rt x3r=round(r-letter_fit-u-right_jut);
bot y6=0; rt x6r=round(r-letter_fit-.75u-right_jut);
x4=x1; y4=1/3h;
alpha1=diag_ratio(1,.5(fudged.hair-tiny),y3-y4,x3r-x4);
penpos3(alpha1*(fudged.hair-tiny),0); penpos4(whatever,-90);
alpha2=diag_ratio(1,.5(fudged.cap_stem-tiny),y1-y6,x6r-x1);
penpos6(alpha2*(fudged.cap_stem-tiny),0);
forsuffixes $=l,r: y3'$=h; y6'$=0; z4$=z3'$+whatever*(z3-z4);
 z5$=z6'$+whatever*(z1-z6)=whatever[z3,z4]; endfor
z5=.5[z5l,z5r];
z3'r=z3r+penoffset z3-z4 of currentpen+whatever*(z3-z4);
% z3'l=z3l+penoffset z4-z3 of currentpen+whatever*(z3-z4);
% previous equation is implied, since z4=.5[z4l,z4r]
z6'r=z6r+penoffset z1-z6 of currentpen+whatever*(z1-z6);
z6'l=z6l+penoffset z6-z1 of currentpen+whatever*(z1-z6);
fill z4r--diag_end(4r,3'r,3'l,4l)--z4l--cycle;	% upper diagonal
fill z5l--diag_end(5l,6'l,6'r,5r)--z5r--cycle;	% lower diagonal
if serifs: numeric inner_jut;
 if rt x2r+cap_jut+u+2≤lft x6l-cap_jut: inner_jut=cap_jut;
 else: rt x2r+cap_jut+u+2=lft x6l-inner_jut; fi
 cup_serif(1,2,a,b,1/3,cap_jut,1/3,cap_jut); % upper stem serif
 cup_serif(2,1,c,d,1/3,cap_jut,1/3,cap_jut);	% lower stem serif
 cup_serif(3,4,e,f,2/3,1.2cap_jut,1/2,right_jut)(dark); % upper diagonal serif
 cup_serif(6,5,g,h,1/2,inner_jut,1/3,right_jut)(dark); fi % lower diagonal serif
math_fit(0,.5ic#); penlabels(1,2,3,4,5,6); endchar;
cmchar "The letter L";
beginchar("L",11u#-width_adj#,cap_height#,0);
adjust_fit(cap_serif_fit#,0);
penpos1(cap_stem-tiny,0); penpos2(cap_stem-tiny,0);
pickup tiny_pen; top y1=h; bot y2=0;
lft x1l=lft x2l=round max(2u,3u-.5cap_stem);
filldraw stroke z1e--z2e; % stem
pickup crisp_pen;
penpos3(slab-crisp,-90); penpos4(hair-crisp,0);
bot y3r=0; x3=x2; y4=y3l+7/6beak; rt x4r=round(w-.75u);
arm.e(3,4,1.2beak_darkness,beak_jut);	% lower arm and beak
if serifs: cup_serif(1,2,a,b,1/3,cap_jut,1/3,1.25cap_jut);	% upper serif
 cup_serif(2,1,c,d,1/3,cap_jut,1/3,.5cap_jut); fi	% lower serif
math_fit(0,u#); penlabels(1,2,3,4); endchar;
cmchar "The letter M";
beginchar("M",16u#+width_adj#,cap_height#,0);
italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
adjust_fit(cap_serif_fit#,cap_serif_fit#);
numeric stem[]; % thicknesses of the four strokes
stem1=round(fudged.hair+stem_corr);
stem2=round(fudged.cap_stem-4stem_corr);
stem3=round(fudged.hair-stem_corr);
stem4=round(fudged.cap_stem-3stem_corr);
if stem4<stem1: stem4:=stem1; fi
penpos1(stem1-tiny,0); penpos2(stem1-tiny,0);
penpos3(stem4-tiny,0); penpos4(stem4-tiny,0);
pickup tiny_pen; top y1=top y3=h; bot y2=bot y4=0;
x1=x2; x3=x4; x1l=w-x3r; rt x3r=round min(w-2u,w-3u+.5stem4);
filldraw stroke z1e--z2e; % left stem
filldraw stroke z3e--z4e; % right stem
penpos5(stem2,0); penpos6(stem2,0); penpos7(stem3,0); penpos8(stem3,0);
x5l=x1; x6l+.5apex_corr=x7l; x8=lft x3l; x6-x5=x8-x7;
y5=y8=h; y6=y7;
if notched: y6=if monospace: round .5bar_height else: o fi;
 numeric notch_height,notch_depth;
 notch_height=h-cap_hair; notch_depth=y6+cap_hair;
 x1'=rt x1r; z1'=whatever[z5l,z6l]; x3'=lft x3l; z3'=whatever[z7r,z8r];
 z0=whatever[z5r,z6r]=whatever[z7l,z8l];
 fill z5l..
  if y1'<notch_height: {right}(x1'+1,notch_height){down}... fi
  {z6-z5}diag_in(5l,6l,6r)..diag_out(7l,7r,8r){z8-z7}
  if y3'<notch_height: ...{up}(x3'-1,notch_height){right} fi
  ..z8r--diag_out(8r,8l,7l){z7-z8}
  if y0<=notch_depth: ..{z7-z8}z0{z5-z6}..
  else: ...{down}(x0+.5,notch_depth)--(x0-.5,notch_depth){up}... fi
  {z5-z6}diag_in(6r,5r,5l)--cycle;	% diagonals
else: y6=0; z0=whatever[z5r,z6r]=whatever[z7l,z8l];
 fill z5l..{z6-z5}diag_in(5l,6l,6r)..diag_out(7l,7r,8r){z8-z7}
  ..z8r--diag_out(8r,8l,7l){z7-z8}..{z7-z8}z0{z5-z6}
  ..{z5-z6}diag_in(6r,5r,5l)--cycle; fi	% diagonals
if serifs: serif.a(1,2,1/3,-cap_jut);	% upper left serif
 cup_serif(2,1,b,c,1/2,cap_jut,1/2,cap_jut)(dark); % lower left serif
 serif.d(3,4,1/3,cap_jut); %	upper right serif
 cup_serif(4,3,e,f,1/3,cap_jut,1/3,cap_jut); fi	% lower right serif
math_fit(0,max(.5ic#-.5u#,0)); penlabels(0,1,1',2,3,3',4,5,6,7,8); endchar;
cmchar "The letter N";
beginchar("N",13u#+width_adj#,cap_height#,0);
italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
adjust_fit(cap_serif_fit#,cap_serif_fit#);
numeric thin_stem; thin_stem=round(fudged.hair+stem_corr);
penpos1(thin_stem-tiny,0); penpos2(thin_stem-tiny,0);
penpos3(thin_stem-tiny,0); penpos4(thin_stem-tiny,0);
pickup tiny_pen; top y1=top y3=h; bot y2=bot y4=0;
x1=x2; x3=x4; x1l=w-x3r; rt x3r=round min(w-2u,w-3u+.5fudged.cap_stem);
filldraw stroke z1e--z2e; % left stem
filldraw stroke z3e--z4e; % right stem
if notched: penpos5(fudged.cap_stem,0); penpos6(fudged.cap_stem,0);
 x5l=x1; x6r=x4; y5=h; y6=0;
 numeric notch_height,notch_depth;
 notch_height=h-cap_hair; notch_depth=cap_hair;
 x1'=rt x1r; z1'=whatever[z5l,z6l]; x4'=lft x4l; z4'=whatever[z5r,z6r];
 fill z5l..
  if y1'<notch_height: {right}(x1'+1,notch_height){down}... fi
  {z6-z5}diag_in(5l,6l,6r)--z6r..
  if y4'>notch_depth: {left}(x4'-1,notch_depth){up}... fi
  {z5-z6}diag_in(6r,5r,5l)--cycle;	% diagonal
else: penpos5(whatever,0); penpos6(whatever,90);
 z5l=z1l; z6l=z4l;
 z7=z6l+(cap_stem-tiny,0) rotated (angle(z5l-z6l)-90);
 z5r=z7+whatever*(z5l-z6l); z6r=z7+whatever*(z5l-z6l);
 filldraw stroke z5e--z6e; fi	% diagonal
if serifs: if notched: serif.a(1,2,1/3,-cap_jut); % upper left serif
 else: serif.a(5,6,1/3,-cap_jut); fi	% upper left serif
 cup_serif(2,1,b,c,1/2,cap_jut,1/2,cap_jut)(dark); % lower left serif
 cup_serif(3,4,e,f,1/2,cap_jut,1/2,cap_jut)(dark); fi	% upper right serif
math_fit(0,max(.5ic#-.5u#,0)); penlabels(1,1',2,3,4,4',5,6,7); endchar;
cmchar "The letter O";
beginchar("O",14u#-width_adj#,cap_height#,0);
italcorr .7cap_height#*slant-.5u#;
adjust_fit(0,0);
penpos1(round(vair+hair_corr),90); penpos3(round(vair+1.5hair_corr),-90);
penpos2(cap_curve,180); penpos4(cap_curve,0);
if monospace: x2r=round 1.5u;
 interim superness:=sqrt superness;	% make |"O"|, not |"0"|
else: x2r=round u; fi
x4r=w-x2r; x1=x3=.5w; y1r=h+o; y2=y4=.5h-hair_corr; y3r=-o;
penstroke pulled_super_arc.e(1,2)(.5superpull)
 & pulled_super_arc.e(2,3)(.5superpull)
 & pulled_super_arc.e(3,4)(.5superpull)
 & pulled_super_arc.e(4,1)(.5superpull) & cycle;	% bowl
math_fit(-.3cap_height#*slant-.5u#,ic#-.5u#); penlabels(1,2,3,4); endchar;
cmchar "The letter P";
beginchar("P",12u#,cap_height#,0);
italcorr .75cap_height#*slant-.5u#;
adjust_fit(cap_serif_fit#,0);
penpos1(cap_stem'-tiny,0); penpos2(cap_stem-tiny,0);
penpos0(cap_stem'-tiny,0); penpos0'(cap_stem-tiny,0);
pickup tiny_pen; top y1=h; bot y2=0;
lft x1l=round max(2u,3u-.5cap_stem');
x1l=x2l=x0l=x0'l; y0=y0'=y7;
penpos3(cap_band,90); penpos4(cap_band,90);
penpos5(cap_curve if notched:-3stem_corr fi,0);
penpos6(vair,-90); penpos7(vair,-90);
z3r=top z1; y4=y3; y5=.5[y4l,y6l]; y6=y7;
x7=x2; y7l=round .5h; x4=x6=.5w+.75u; x5r=round(w-u);
x4l:=x6l:=x4-.25cap_curve;
filldraw stroke z1e--z0e--z0'e--z2e; % stem
fill stroke z3e..pulled_super_arc.e(4,5,superpull)
  & pulled_super_arc.e(5,6,superpull)..z7e;	% lobe
if serifs: cup_serif(1,2,a,b,1/3,cap_jut,1/3,.5cap_jut);	% upper serif
 cup_serif(2,1,c,d,1/3,cap_jut,1/3,cap_jut); fi	% lower serif
math_fit(0,ic#-2.5u#); penlabels(0,1,2,3,4,5,6,7); endchar;
cmchar "The letter Q";
beginchar("Q",14u#-width_adj#,cap_height#,comma_depth#);
italcorr .7cap_height#*slant-.5u#;
adjust_fit(0,0);
numeric reduced_curve; reduced_curve=cap_curve-round 2stem_corr;
penpos1(round(vair+hair_corr),90); penpos3(round(vair+hair_corr),-90);
penpos2(reduced_curve,180); penpos4(reduced_curve,0);
if monospace: x2r=round 1.5u;
 interim superness:=sqrt superness;	% make |"Q"| like |"O"|
else: x2r=round u; fi
x4r=w-x2r; x1=x3=.5w; y1r=h+o; y2=y4=.5h-hair_corr; y3r=-o;
penstroke pulled_super_arc.e(1,2)(.5superpull)
 & pulled_super_arc.e(2,3)(.5superpull)
 & pulled_super_arc.e(3,4)(.5superpull)
 & pulled_super_arc.e(4,1)(.5superpull) & cycle;	% bowl
pickup tiny_pen;
if notched: penpos5(cap_bar,0); penpos6(reduced_curve,0);
 x5=.5w+.25u; x6r=round(w-1.5u);
 y5=round .28h; y6=-d;
 fill diag_end(6r,5r,5l,6l)--diag_end(5l,6l,6r,5r)--cycle;	% tail
else: penpos3'(vair-tiny,-90); penpos5(vair-tiny,90);
 penpos6(cap_curve-tiny,85); penpos7(3epsilon,180);
 z3'=z3; x5=x3; top y5r=round(.2h+.5vair);
 bot y6l=-d; x6l=2/3[x5,x7]; y7=0; rt x7=round(x4r+.1u);
 filldraw stroke z3'e{left}..z5e{right}..z6e{right}..z7e{up}; fi	% tail
math_fit(-.3cap_height#*slant-.5u#,ic#);
penlabels(1,2,3,4,5,6,7); endchar;
cmchar "The letter R";
beginchar("R",if serifs: 13u# else:12.5u#-.5width_adj# fi,cap_height#,0);
italcorr .75cap_height#*slant- if serifs: 1.75 else: .5 fi u#;
adjust_fit(cap_serif_fit#,0);
penpos1(cap_stem'-tiny,0); penpos2(cap_stem'-tiny,0);
pickup tiny_pen; top y1=h; bot y2=0;
lft x1l=lft x2l=round max(2u,3u-.5cap_stem');
filldraw stroke z1e--z2e; % stem
penpos3(cap_band,90); penpos4(cap_band,90);
penpos5(cap_curve if notched:-3stem_corr fi,0);
penpos6(vair,-90); penpos7(vair,-90);
z3r=top z1; y4=y3; y5=.5[y4l,y6l]; y6=y7;
x7=x2; y7l=round(.5h+.5vair); x4=x6;
if serifs: x4=.5w-.5u; x5r=round(w-2.25u);
else: x4=.5w+.5u; x5r=round(w-u); fi
x4l:=x6l:=x4-.125cap_curve;
fill stroke z3e..pulled_super_arc.e(4,5,superpull)
  & pulled_super_arc.e(5,6,superpull)..z7e;	% lobe
if serifs: penpos6'(vair-tiny,-90); penpos0(cap_stem-tiny,180);
 penpos8(cap_curve-tiny,180); penpos9(vair-tiny,-90); penpos10(hair-tiny,0);
 z6'=z6; lft x0r=lft x8r=round(x5-u-.5cap_curve);
 y8=1/3[y2,y7]; y0=3/5[y2,y7]; x9=.5[x8l,x10r];
 bot y9r=-o; rt x10r=round(w-.25u); y10=1/4[y2,y7];
% (x,y9r)=whatever[z9l,z10l]; x9r:=x; % seems unnecessary
% filldraw stroke z6'e{right}..z0e if str.e="r":--- else:.. fi z8e % fails in tt
 filldraw stroke z6'e{right}..z0e---z8e
  ..tension atleast .9..z9e{right}..z10e{up};	% tail
 cup_serif(1,2,a,b,1/3,cap_jut,1/3,.5cap_jut);	% upper serif
 cup_serif(2,1,c,d,1/3,cap_jut,1/3,cap_jut);	% lower serif
else: penpos8(cap_stem-2stem_corr,0); penpos9(cap_stem,0);
 x8=x6+.5u; y8=y6; x9r=round(w-.5u); y9=0;
 fill z8l--diag_end(8l,9l,9r,8r)--z8r--cycle; fi	% tail
math_fit(0,.75ic#); penlabels(0,1,2,3,4,5,6,7,8,9,10); endchar;
cmchar "The letter S";
beginchar("S",10u#+width_adj#,cap_height#,0);
italcorr cap_height#*slant-u#;
adjust_fit(0,0);
numeric theta; theta=90-angle(40u,h);	% angle at middle
pickup teeny_pen; penpos2(slab-round(hair_corr)-teeny,-90);
penpos4(cap_ess-teeny,theta); penpos5(cap_ess-teeny,theta);
penpos7(slab-teeny,-90);
x2+x7=x4+x5=w; x7-x2=u; x5-x4=1.5u; top y2l=h+o; bot y7r=-o;
.5[y4,y5]=.52h; z5-z4=whatever*dir(theta-90);
lft x3l=round u; rt x6r=round(w-u);
y3l=.52[.5[y4l,y5l],y2l]; y6r=.52[.5[y4r,y5r],y7r];
z3r=parallel_pos(.5[slab,cap_ess]-teeny,z3l,z2l,z2r);
z6l=parallel_pos(.5[slab,cap_ess]-teeny,z6r,z7r,z7l);
numeric tau; tau=max(.8,.20710678/(superness-.5));
filldraw stroke z2e{left}..tension atleast tau..z3e{down}
 ..tension atleast tau and atleast 1..z4e---z5e
 ..tension atleast 1 and atleast tau..z6e{down}
 ..tension atleast tau..z7e{left};	% main stroke
if serifs: penpos1(hair-teeny,180); penpos8(hair-teeny,180);
 rt x1l=round(w-1.5u); lft x8r=round u;
 bot y1=round 2/3h+1; top y8=round 1/3h-1;
 filldraw stroke z1e{curl.5}..{left}z2e;	% upper arc
 filldraw stroke z7e{left}..z8e;	% lower arc
 path upper_arc, lower_arc;
 upper_arc=z1{curl.5}..{left}z2; lower_arc=z7{left}..z8;
 x0=x1l; top y0=h; x9=x8r; bot y9=0;
 x1l-x1'=x8'-x8r=cap_curve-tiny; y1'=y1; y8'=y8;
 numeric t; t=xpart(upper_arc intersectiontimes(z0..z1'));
 filldraw z1l--z0--subpath(t,0) of upper_arc--cycle;	% upper barb
 t:=xpart(lower_arc intersectiontimes(z9..z8'));
 filldraw z8r--z9--subpath(t,1) of lower_arc--cycle;	% lower barb
else: penpos1(1.1flare-teeny,-90); penpos8(1.2flare-teeny,-90);
 rt x1=round(w-1.75u); lft x8=round u;
 top y1l=round .93h+o; bot y8r=round .1h-o;
 filldraw stroke z1e..tension.9..{left}z2e;	% upper arc and terminal
 filldraw stroke z7e{left}..z8e; fi	% lower arc and terminal
math_fit(0,.5ic#); penlabels(0,1,1',2,3,4,5,6,7,8,8',9); endchar;
cmchar "The letter T";
beginchar("T",13u#-width_adj#,cap_height#,0);
italcorr cap_height#*slant-beak_jut#-.25u#;
adjust_fit(0,0);
h:=round(h-2stem_corr);
penpos1(cap_stem-tiny,0); penpos2(cap_stem-tiny,0);
pickup tiny_pen; top y1=h; bot y2=0;
lft x1l=lft x2l=round(.5w-.5cap_stem);
filldraw stroke z1e--z2e; % stem
pickup crisp_pen; penpos3(slab-crisp,90); penpos4(hair-crisp,0);
top y3r=h; x3=x1; rt x4r=round(w-.65u); y4=good.y(y3l-beak);
arm.e(3,4,beak_darkness,.7beak_jut);	% right arm and beak
penpos5(hair-crisp,180); x5=w-x4; y5=y4;
arm.f(3,5,beak_darkness,-.7beak_jut);	% left arm and beak
if serifs: cup_serif(1,2,a,b,1/3,.5cap_jut,1/3,.5cap_jut);	% upper serif
 cup_serif(2,1,c,d,1/3,1.414cap_jut,1/3,1.414cap_jut); fi	% lower serif
math_fit(-.75cap_height#*slant,ic#-2.5u#); penlabels(1,2,3,4,5,6); endchar;
cmchar "The letter U";
beginchar("U",13u#+.5width_adj#,cap_height#,0);
italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
if monospace: adjust_fit(cap_serif_fit#-.5u#,cap_serif_fit#-.5u#)
else: adjust_fit(cap_serif_fit#,cap_serif_fit#) fi;
penpos1(cap_stem-tiny,0); penpos2(cap_stem-tiny,0);
penpos2'(cap_stem-tiny,180); z2'=z2;
penpos3(cap_band-tiny,-90);
penpos4(cap_hair-tiny,0); penpos5(cap_hair-tiny,0);
pickup tiny_pen; top y1=top y5=h; y2=y4=1/3h; bot y3r=-o;
x1=x2; x3=.5[x1,x5]; x4=x5; x1l=w-x5r;
lft x1l=round max(2u,3u-.5cap_stem);
filldraw stroke z1e--z2e; % left stem
filldraw stroke pulled_super_arc.e(2',3,superpull)
 &pulled_super_arc.e(3,4,superpull)&z4e--z5e; % arc and right stem
if serifs: cup_serif(1,2,a,b,1/3,cap_jut,1/3,cap_jut); % left serif
 cup_serif(5,4,c,d,1/2,cap_jut,1/2,cap_jut)(dark); fi	% right serif
math_fit(-cap_serif_fit#-.3cap_height#*slant-max(cap_height#*slant,u#),
 max(.5ic#-.5u#,0)); penlabels(1,2,3,4,5); endchar;
cmchar "The letter V";
beginchar("V",13u#,cap_height#,0);
italcorr cap_height#*slant+.25u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
numeric right_stem,outer_jut,notch_height,alpha;
right_stem=cap_hair if notched:-2stem_corr fi;
outer_jut=.75cap_jut; x1l=w-x4r=l+letter_fit+outer_jut+.25u; y1=y4=h;
x2-x1=x4-x3; x2l+apex_corr=x3l; y2=y3=-apex_o;
alpha=diag_ratio(2,right_stem,y1-y2,x4r-x1l-apex_corr);
penpos1(alpha*cap_stem,0); penpos2(alpha*cap_stem,0);
penpos3(alpha*right_stem,0); penpos4(alpha*right_stem,0);
z0=whatever[z1r,z2r]=whatever[z3l,z4l]; notch_height=cap_hair;
if notched and (y0>notch_height): y0:=notch_height;
  fill z0+.5right{up}...{z4-z3}diag_end(3l,4l,4r,3r)
    --diag_end(4r,3r,2l,1l)--diag_end(2l,1l,1r,2r){z2-z1}
    ...{down}z0+.5left--cycle; % left and right diagonals
else: fill z0--diag_end(0,4l,4r,3r)--diag_end(4r,3r,2l,1l)
    --diag_end(2l,1l,1r,0)--cycle; fi % left and right diagonals
if serifs: numeric inner_jut; pickup tiny_pen;
 diag_inside(1,2); diag_inside(4,3);
 if rt x1'r+cap_jut+1.5u+2≤lft x4'l-cap_jut: inner_jut=cap_jut;
 else: rt x1'r+inner_jut+1.5u+2=lft x4'l-inner_jut; fi
 cup_serif(1',2,a,b,1/3,outer_jut,1/2,inner_jut);	% left serif
 cup_serif(4',3,c,d,.6,inner_jut,1/2,outer_jut)(dark); fi	% right serif
math_fit(ic#-2cap_height#*slant,ic#-4u#); penlabels(0,1,2,3,4); endchar;
cmchar "The letter W";
beginchar("W",18u#,cap_height#,0);
italcorr cap_height#*slant+.25u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
numeric stem[],outer_jut,notch_height,alpha;
outer_jut=.7cap_jut; x1l=w-x8r=l+letter_fit+outer_jut+.25u;
stem1=fudged.cap_stem;
stem4=fudged.hair if notched:-2stem_corr fi;
stem2=stem4 if notched:-2stem_corr fi;
stem3=stem1 if notched:-2stem_corr fi;
x2-x1=x4-x3=x6-x5=x8-x7; x2l+apex_corr=x3l; x6l+apex_corr=x7l;
y1=y8=h; y2=y3=y6=y7=-apex_o;
y4=y5=if monospace: round.85 fi h;
alpha=diag_ratio(4,stem2-stem3+stem4,y1-y2,x8r-x1l-3apex_corr);
penpos1(alpha*stem1,0); penpos2(alpha*stem1,0);
penpos3(alpha*stem2,0); penpos4(alpha*stem2,0);
penpos5(alpha*stem3,0); penpos6(alpha*stem3,0);
penpos7(alpha*stem4,0); penpos8(alpha*stem4,0);
x4l-x1l=floor(x4l-x1l+.5(x5r-x4r-apex_corr)); % |x5r| $\approx$ |x4r+apex_corr|
z23=whatever[z1r,z2r]=whatever[z3l,z4l];
z45=whatever[z3r,z4r]=whatever[z5l,z6l];
z67=whatever[z5r,z6r]=whatever[z7l,z8l];
notch_height=h-cap_hair;
fill diag_end(1l,2l,3r,4r){z4-z3}
 ...if notched and(y45>notch_height):(x45,notch_height)+.5left{up}
   --(x45,notch_height)+.5right{down} else: z45&z45 fi
 ...{z6-z5}diag_end(5l,6l,7r,8r)--diag_end(7r,8r,8l,7l){z7-z8}
 ...if notched and(y67<cap_hair):(x67,cap_hair)+.5right{down}
   --(x67,cap_hair)+.5left{up} else: z67&z67 fi
 ...{z5-z6}diag_end(6r,5r,4l,3l){z3-z4}
 ...if notched and(y23<cap_hair):(x23,cap_hair)+.5right{down}
   --(x23,cap_hair)+.5left{up} else: z23&z23 fi
 ...{z1-z2}diag_end(2r,1r,1l,2l)--cycle;	% diagonals
if serifs: numeric inner_jut[]; pickup tiny_pen;
 diag_inside(1,2); diag_inside(5,6); diag_inside(8,7);
 if monospace or notched: inner_jut1=inner_jut4=cap_jut;
 else: fill diag_end(6r,5r,5l,6l)--.5[z5l,z6l]--.5[z5r,z6r]--cycle;% middle stem
  inner_jut1=inner_jut2; inner_jut4=1.1inner_jut3;
  if rt x1'r+cap_jut+u+2≤lft x5'l-cap_jut: inner_jut1=cap_jut;
  else: rt x1'r+inner_jut1+u+2=lft x5'l-inner_jut2; fi
  if rt x5'r+cap_jut+u+2≤lft x8'l-1.1cap_jut: inner_jut3=cap_jut;
  else: rt x5'r+inner_jut3+u+2=lft x8'l-inner_jut4; fi
  cup_serif(5',6,e,f,1/3,inner_jut2,1/2,inner_jut3); fi	% middle serif
 cup_serif(1',2,a,b,1/3,outer_jut,1/2,inner_jut1);	% left serif
 cup_serif(8',7,c,d,.6,inner_jut4,1/2,outer_jut)(dark); fi	% right serif
math_fit(ic#-2cap_height#*slant,ic#-2.5u#);
penlabels(1,2,3,4,5,6,7,8,23,45,67); endchar;
cmchar "The letter X";
beginchar("X",13u#,cap_height#,0);
italcorr cap_height#*slant-.25u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
numeric stem[],outer_jut,xjut,alpha[];
stem1=cap_stem; stem2=cap_hair;
outer_jut=.75cap_jut; xjut= if serifs: (stem1-stem2)/4 else: 0 fi;
x1l=l+letter_fit+.5u+outer_jut; x2r=r-letter_fit-u-outer_jut-xjut; y1=y2=h;
x3l=l+letter_fit+.25u+outer_jut+xjut; x4r=r-letter_fit-.25u-outer_jut; y3=y4=0;
alpha1=diag_ratio(1,stem1,h,x4r-x1l);
alpha2=diag_ratio(1,stem2,h,x2r-x3l);
penpos1(alpha1*stem1,0); penpos2(alpha2*stem2,0);
penpos3(alpha2*stem2,0); penpos4(alpha1*stem1,0);
if notched: z0=whatever[z1,z4]=whatever[z2,z3];
 x12=x34=x0; y13=y24=y0;
 z12=whatever[z2l,z3l]; z13=whatever[z2l,z3l];
 z24=whatever[z2r,z3r]; z34=whatever[z2r,z3r];
 fill diag_end(12,1r,1l,13)--z13--diag_end(13,3l,3r,34)--z34
  --diag_end(34,4l,4r,24)--z24--diag_end(24,2r,2l,12)--z12--cycle; % diagonals
else: fill diag_end(4r,1r,1l,4l)--diag_end(1l,4l,4r,1r)--cycle; % left diagonal
 fill diag_end(2l,3l,3r,2r)--diag_end(3r,2r,2l,3l)--cycle; fi	% right diagonal
if serifs: numeric inner_jut[]; pickup tiny_pen;
 diag_inside(1,4); diag_inside(2,3); diag_inside(3,2); diag_inside(4,1);
 if rt x1'r+cap_jut+u+2≤lft x2'l-cap_jut-xjut: inner_jut1=cap_jut;
 else: rt x1'r+inner_jut1+u+2=lft x2'l-inner_jut1-xjut; fi
 if rt x3'r+cap_jut+u+2≤lft x4'l-cap_jut-xjut: inner_jut2=cap_jut;
 else: rt x3'r+inner_jut2+u+2=lft x4'l-inner_jut2-xjut; fi
 cup_serif(1',4,a,b,1/3,outer_jut,2/3,inner_jut1);	% upper left serif
 cup_serif(4',1,c,d,2/3,inner_jut2,1/3,outer_jut);	% lower right serif
 cup_serif(2',3,e,f,
  2/3,inner_jut1+xjut,1/2,outer_jut+xjut)(dark);	% upper right serif
 cup_serif(3',2,g,h,
  1/2,outer_jut+xjut,2/3,inner_jut2+xjut)(dark); fi	% lower left serif
math_fit(0,.5ic#); penlabels(0,1,2,3,4,12,13,24,34); endchar;
cmchar "The letter Y";
beginchar("Y",13u#,cap_height#,0);
italcorr cap_height#*slant+.45u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
numeric right_stem,outer_jut,notch_height,dy,alpha;
right_stem=cap_hair if notched:-2stem_corr fi;
outer_jut=.75cap_jut; x1l=w-x4r=l+letter_fit+outer_jut+.05u;
x2l=x5l=round(.5w-.5cap_stem); x3r=x5r; y1=y4=h; y2=y3=y5=.4h;
dy=y1-y2; alpha=((x2l-x1l)++dy)/dy;
penpos1(alpha*cap_stem,0); penpos2(alpha*cap_stem,0);
penpos3(alpha*right_stem,0); penpos4(alpha*right_stem,0);
penpos5(cap_stem,0); penpos6(cap_stem,0); x5=x6; y6=0;
z0=whatever[z1r,z2r]=whatever[z3l,z4l]; notch_height=y2+cap_hair;
if notched and (y0>notch_height): y0:=notch_height;
  fill z0+.5right{up}...{z4-z3}diag_end(3l,4l,4r,3r)--z5r
    --diag_end(5r,6r,6l,5l)--z5l--diag_end(2l,1l,1r,2r){z2-z1}
    ...{down}z0+.5left--cycle; % diagonals and stem
else: fill z0--diag_end(0,4l,4r,3r)--z5r
    --diag_end(5r,6r,6l,5l)--z5l
    --diag_end(2l,1l,1r,0)--cycle; fi  % diagonals and stem
if serifs: numeric inner_jut; pickup tiny_pen;
 diag_inside(1,2); diag_inside(4,3); diag_inside(6,5);
 if rt x1'r+cap_jut+1.5u+2≤lft x4'l-cap_jut: inner_jut=cap_jut;
 else: rt x1'r+inner_jut+1.5u+2=lft x4'l-inner_jut; fi
 cup_serif(1',2,a,b,1/3,outer_jut,1/2,inner_jut);	% upper left serif
 cup_serif(4',3,c,d,.6,inner_jut,1/2,outer_jut)(dark);	% upper right serif
 cup_serif(6',5,e,f,1/3,cap_jut,1/3,cap_jut); fi	% lower serif
math_fit(ic#-2cap_height#*slant,ic#-4u#); penlabels(0,1,2,3,4,5,6); endchar;
cmchar "The letter Z";
beginchar("Z",11u#,cap_height#,0);
italcorr cap_height#*slant-.5u#;
adjust_fit(0,0);
numeric arm_thickness[];
arm_thickness1=round(slab-stem_corr); arm_thickness2=round(slab+2stem_corr);
if arm_thickness1<tiny_breadth: arm_thickness1:=tiny_breadth; fi
pickup tiny_pen; x3l=x4l=w-x1r=w-x2r; lft x3l=round u;
top y1=h; bot y2=h-arm_thickness1; top y3=arm_thickness2; bot y4=0;
numeric alpha; alpha=diag_ratio(1,cap_stem-tiny,y2-y3,x2r-x3l);
penpos1(alpha*(cap_stem-tiny),0); penpos2(alpha*(cap_stem-tiny),0);
penpos3(alpha*(cap_stem-tiny),0); penpos4(alpha*(cap_stem-tiny),0);
filldraw stroke z1e--z2e--z3e--z4e;	% diagonal
pickup crisp_pen; penpos5(arm_thickness1-crisp,90); penpos6(hair-crisp,180);
top y5r=h; x5=x1; lft x6r=round 1.5u; y6=good.y(y5l-beak);
arm.a(5,6,beak_darkness,-.4beak_jut);	% upper arm and beak
penpos7(arm_thickness2-crisp,-90); penpos8(hair-crisp,0);
bot y7r=0; x7=x4; rt x8r=round(w-.9u); y8=good.y(y7l+1.2beak);
arm.b(7,8,beak_darkness,.6beak_jut);	% lower arm and beak
math_fit(0,.5ic#); penlabels(1,2,3,4,5,6,7,8); endchar;